Repository navigation
Conversation
Member
|
mh, I need to look deeper into this, but this could be a legit good fix have you encountered instances where this fixes problems? |
Author
I was testing Soma Bringer multiplayer game with 2 instances, finding that the connection would fail if the host started the game too quickly right after a client entered the party. This commit effectively fixes the problem. I will try to produce a video capture to demonstrate the disconnection problem. |
Author
|
Here are the video captures. Before the fix: buggy.mp4After the fix: fixed.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The MP host used
16 + PreambleLen(about 112 us) as the timeout for the first client reply and cleared the client from MPClientMask at that point. GBATEK specifies that the hardware waits16 + ((10 + W_CMD_REPLYTIME) * client_count)before sending the CMD ACK, so large CMDs could be marked as failed before the client had time to reply. The host then retransmitted the same CMD, filled the client's receive queue, and eventually disconnected.Poll replies non-blocking throughout the documented reply window, keep the CMD timestamp fixed for the stale check, and use the full timeout. Process the first client's reply as soon as it arrives instead of waiting for the timeout to expire.